﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="DeliverGoodsManagement_AddSettlement" Codebehind="AddSettlement.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
<style type="text/css">
.hidden{visibility:hidden;}
body {font-size:12px;margin:0;padding:0;}
a:visited{text-decoration:none;color:slategray;}
a:hover{text-decoration:underline;color:slategray;}
a:link{text-decoration:none;color:slategray;}
.juli {margin-top:10px;padding-left:20px;}
.z1{background-color:#e7e7e7; text-align:left; line-height:20px;}
.z2{background-color:#FFFFFF; text-align:left; line-height:20px;}
.zt3 {text-align:center; font-weight:600; color:#000000;}
.zt4 {text-align:center; color:#000000;}
.zt5 {text-align:right; color:#000000;}
.zt7 {text-align:right; color:#000000;}
.tb {width:1050px;background-color:#999999;}
.tb1 {background-color:#999999;}
a.lj {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:link {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:visited {font-size:12px; color:#ff9900; text-decoration:underline;}
a.lj:hover {color:#ff3300;}
a.lj:active {color:#ff3300;}
.menu_bg { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 1px solid;}
.input_button {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;}
.input_button1 {width:74px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt1.gif) no-repeat;}
.input_button2 {width:52px;height:23px;border:none;background:#ffffff url(../Include/Images/bt.gif) no-repeat; padding-top:5px;}
.input_button2 a{color:#000000;}
.input_button2 a:hover{color:#FF3300; text-decoration:underline;}
.input_button3 {width:95px;height:23px;border:none;background:#ffffff url(../Include/Images/bt2.gif) no-repeat;}
.input_button4 {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;font-weight:bold;}
.kuandu {width:30px; text-align:left;}
.kuandu1 {width:60px; text-align:right;}
.kuandu2 {width:120px; text-align:left;}
.kuandu3 {width:150px; text-align:left;}
.kuandu4 {width:100px; text-align:left;}
.kuandu5 {width:155px; text-align:left;}
.bk_left {border-bottom:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 1px solid;border-top:#999999 0px solid;}
.bk_middle {border-bottom:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 0px solid;border-top:#999999 0px solid;}
h2 {padding-left:20px;padding-top:10px;margin:0; background: url(../Include/Images/menu_title.gif) repeat-x;height:21px;font-size:14px; font-weight:600;}
.menu_bg1 { background-color:#f5f5f5; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cccccc 1px solid;border-top:#cccccc 1px solid;clear:left;}
</style>   
    <script type="text/javascript" src="../Include/Js/OpenWindow.js"></script>
    <script type="text/javascript" src="../Include/Js/SocanCode.js"></script>
    <script type="text/javascript" src="../Include/Js/PopupCalendar.js"></script>
    <script type="text/javascript" src="../Include/Js/calendar.js"></script>
    <script type="text/javascript">
       function setVIPValue(p)
       {
            var gk=p.split("|");
            document.getElementById("txtUserCode").innerText=gk[0];
       }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div align="Justify">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <h2>
        新增结算单</h2>
        <div class="menu_bg"><asp:Button ID="btnSave" runat="server" CssClass="input_button" Text="保存" OnClick="btnSave_Click" />
        <asp:Button ID="btnCancel" runat="server" CssClass="input_button" Text="取消" OnClick="btnCancel_Click" /></div>
    <div>
<div class="menu_bg1">　　会员：<asp:TextBox ID="txtUserCode" CssClass="kuandu4" runat="server" ></asp:TextBox>
        <asp:Button ID="btnChooseCustomer" runat="server" CssClass="input_button4" Text="..." OnClientClick="SearchVIP('../');" OnClick="btnChooseCustomer_Click" />&nbsp;<br />
        结算类型：<asp:DropDownList ID="dropSettlementType" Width="161" runat="server" AutoPostBack="True" OnSelectedIndexChanged="dropSettlementType_SelectedIndexChanged">
            <asp:ListItem Value="001">应收款</asp:ListItem>
            <asp:ListItem Value="002">预收款</asp:ListItem>
        </asp:DropDownList>&nbsp;<br /> 
        支付金额：<asp:TextBox ID="txtReceiveMoneyAmount" CssClass="kuandu5" runat="server" Text="0.00" Enabled="false"></asp:TextBox>&nbsp;<br />
        结算金额：<asp:TextBox ID="txtPayAmount" CssClass="kuandu5" runat="server" Enabled="false" Text="0.00"></asp:TextBox>&nbsp;<br />
        结余金额：<asp:TextBox ID="txtBalance" runat="server" CssClass="kuandu5" Enabled ="false" Text="0.00"></asp:TextBox>&nbsp;<br />
        　　备注：<asp:TextBox ID="txtNotes" runat="server" Height="16px" Width="155px"></asp:TextBox></div>
        

        <div class="juli"><asp:DataList ID="dlistOrder" runat="server" OnItemDataBound="dlistOrder_ItemDataBound" OnItemCommand="dlistOrder_ItemCommand" CellPadding="0">
            <HeaderTemplate>
                <table width="800" class="tb1" border="0" cellspacing="1" cellpadding="0">
                    <tr class="z1">
                        <td width="60" align="center">
                            
                        </td>
                        <td class="zt3" width="100" align="center">
                            单据性质
                        </td>
                        <td class="zt3" align="center">
                            单据编号
                        </td>
                        <td class="zt3" width="110" align="center">
                            日期
                        </td>
                        <td class="zt3" width="90" align="center">
                            总金额

                        </td>
                        <td class="zt3" width="90" align="center">
                            已结算金额

                        </td>
                        <td class="zt3" width="90" align="center">
                            余额
                        </td>
                        <td class="zt3" width="90" align="center">
                            本次结算金额
                        </td>
                    </tr>
                </table>
            </HeaderTemplate>
            <ItemTemplate>
                <table width="800" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="60" align="center" class="bk_left"><asp:CheckBox ID="checkRow" runat="server" /><asp:Button ID="btnCheck" CssClass="hidden" runat="server" Text="" CommandName="check" /></td>
                        <td width="100" align="center" class="bk_middle">
                            <asp:Label ID="lblDealType" runat="server" Text='<%# Eval("DocType")%>'></asp:Label>
                        </td>
                        <td align="center" class="bk_middle">
                            <asp:Label ID="lblOrderId" runat="server" Text='<%# Eval("DocId")%>'></asp:Label>
                        </td>
                        <td width="110" align="center" class="bk_middle">
                            <asp:Label ID="lblCreateDate" runat="server" Text='<%# Eval("DocDate")%>'></asp:Label>
                        </td>
                        <td width="90" align="right" class="bk_middle">
                            <asp:Label ID="lblTotal" runat="server" Text='<%#  String.Format("{0:0.00}",Eval("DocAmount"))%>'></asp:Label>
                        </td>
                        <td width="90" align="right" class="bk_middle">
                            <asp:Label ID="lblClearAmount" runat="server" Text='<%#  String.Format("{0:0.00}",Eval("DocClearAmt"))%>'></asp:Label>
                        </td>
                        <td width="90" align="right" class="bk_middle">
                            <asp:Label ID="lblSub" runat="server" Text='<%# String.Format("{0:0.00}",Convert.ToDecimal(Eval("DocAmount"))-Convert.ToDecimal(Eval("DocClearAmt")))%>'></asp:Label>    
                        </td>
                        <td width="90" align="center" class="bk_middle">
                            <asp:TextBox ID="txtCurrentClearAMT" runat="server" Text='<%# String.Format("{0:0.00}",Convert.ToDecimal(Eval("DocAmount"))-Convert.ToDecimal(Eval("DocClearAmt")))%>' Width="60px" CssClass="zt7" Visible="false"></asp:TextBox>
                            <asp:Button ID="btnUpdateCurrentClearAMT" runat="server" CssClass="hidden" Text="" CommandName="UpdateCurrentClearAMT" /></td> 
                    </tr>
                </table>
            </ItemTemplate>
        </asp:DataList></div><br />
        <div class="menu_bg"><asp:Button ID="btnAddPayDocPayDetail" runat="server" CssClass="input_button3" Text="添加支付明细" OnClick="btnAddPayDocPayDetail_Click" /></div>
        <div class="juli"><asp:DataList ID="dlistPayDocPayDetail" runat="server" OnItemDataBound="dlistPayDocPayDetail_ItemDataBound" OnItemCommand="dlistPayDocPayDetail_ItemCommand" CellPadding="0">
            <HeaderTemplate>
                <table class="tb" border="0" cellspacing="1" cellpadding="0">
                    <tr class="z1">
                        <td class="zt3" width="60">
                            删除
                        </td>
                        <td class="zt3" width="70">
                            交易类型
                        </td>
                        <td class="zt3" width="110">
                            支付方式
                        </td>
                        <td class="zt3" width="100">
                            支付金额
                        </td>
                        <td class="zt3" width="130">
                            支付日期
                        </td>
                        <td class="zt3" width="130">
                            交易号

                        </td>
                        <td class="zt3" width="130">
                            交易日期
                        </td>
                        <td class="zt3" width="130">
                            帐号
                        </td>
                        <td class="zt3">
                            备注
                        </td>
                    </tr>
                </table>
            </HeaderTemplate>
            <ItemTemplate>
                <table width="1050" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="60" align="center" class="bk_left">
                            <asp:Button ID="btnDelete" CssClass="input_button" runat="server" Text="删除" CommandName="Del" />
                        </td>
                        <td width="70" align="center" class="bk_middle">
                            <asp:DropDownList ID="dropDealType" runat="server" Width="55"  AutoPostBack="true" OnSelectedIndexChanged="DataList2_DDLCHANGE_Click">
                            <asp:ListItem Text="即时到帐" Value="001"></asp:ListItem>
                            <asp:ListItem Text="担保交易" Value="002"></asp:ListItem>
                            <asp:ListItem Text="结余款" Value="003"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td width="110" align="center" class="bk_middle">
                            <asp:DropDownList ID="dropPayType" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td width="100" align="center" class="bk_middle">
                            <asp:TextBox ID="txtPayAmount" CssClass="kuandu1" runat="server" Text='<%# Eval("PDPD_PAYAMT")%>'></asp:TextBox>
                            <asp:Button ID="btnUpDatePayAmount" runat="server" Text="" CommandName="upt" CssClass="hidden" />
                        </td>
                        <td width="130" align="center" class="bk_middle">
                            <asp:TextBox ID="txtPayDate" CssClass="kuandu2" runat="server" Text='<%# Convert.ToDateTime(Eval("PDPD_PAYDATE")).ToShortDateString()%>' OnClick="setday(this)" ></asp:TextBox>
                        </td>
                        <td width="130" align="center" class="bk_middle">
                            <asp:TextBox ID="txtDealID" CssClass="kuandu2" runat="server" Text='<%# Eval("PDPD_DEALID")%>'></asp:TextBox>
                        </td>
                        <td width="130" align="center" class="bk_middle">
                            <asp:TextBox ID="txtDealDate" CssClass="kuandu2" runat="server" Text='<%# Convert.ToDateTime(Eval("PDPD_DEALDATE")).ToShortDateString()%>' OnClick="setday(this)"></asp:TextBox>
                        </td>
                        <td width="130" align="center" class="bk_middle">
                            <asp:TextBox ID="txtAccount" CssClass="kuandu2" runat="server" Text='<%# Eval("PDPD_ACCOUNT")%>'></asp:TextBox>
                        </td>
                        <td align="center" class="bk_middle">
                            <asp:TextBox ID="txtNotes" CssClass="kuandu3" runat="server" Text='<%# Eval("PDPD_NOTE")%>'></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:DataList>
        </div>
        </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    
        </div>
    </form>
</body>
</html>

